---
layout: "default"
title: "join"
description: "Swift documentation for 'join': Creates and returns a collection of type C that is the result of."
keywords: "join,func,swift,documentation"
root: "/v1.2"
---

<div class="declaration" id="func-join-c_-extensiblecollectiontype-s_-sequencetype-where-c-c_-c-elements_-s">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-join-c_-extensiblecollectiontype-s_-sequencetype-where-c-c_-c-elements_-s">func <wbr>join&lt;C :<wbr> ExtensibleCollectionType, S : SequenceType where C == C&gt;(<wbr>_:<wbr> C, elements: S)</a>
        
<div class="comment collapse" id="comment-func-join-c_-extensiblecollectiontype-s_-sequencetype-where-c-c_-c-elements_-s"><div class="p">
    <p>Creates and returns a collection of type <code>C</code> that is the result of
interposing a given separator between the elements of the sequence
<code>elements</code>.</p>

<p>For example, this code excerpt writes &quot;<code>here be dragons</code>&quot; to the standard
output:</p>

<pre><code class="language-swift">println(join(&quot; &quot;, [ &quot;here&quot;, &quot;be&quot;, &quot;dragons&quot; ]))</code></pre>

    <h4>Declaration</h4>    
    <code class="language-swift">func join&lt;C : ExtensibleCollectionType, S : SequenceType where C == C&gt;(separator: C, elements: S) -&gt; C</code>
    
    
</div></div>
</div>
